JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

all:
	javah -jni HelloWorld
	gcc -shared -fPIC -o libhello.so -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux hello.c
	javac HelloWorld.java
	jar cvf libhello.jar HelloWorld.class
	javac JniLoader.java
	@echo "===== run ====="
	java JniLoader
    
clean:
	rm -f *.class *.so *.jar HelloWorld.h